<?php $user=$session->read('User');
$companyid=$session->read("companyid");
?>
<div class="right_side_operate_area">
	<div class="right_side_title left">
		<h2>
		<?php 
		$companyname=$session->read("companyname");
		echo $html->link($companyname,"/companys/showinfosummary/".$companyid);
		?>
		</h2>
		<div class="clear"></div>
	</div>
    <div class="right item_add_btn">
    <?php 
    	if($form->value('CompJobapply.id'))
    	{
    		$str_title=__("Edit",true);
		}
		else
		{
			$str_title=__("Add",true);
		}
		echo $html->link(__("Cancel",true).$str_title,"/companys/applyjob/");
    ?>
    </div>
    <div class="clear"></div>
</div>

<div class="right_side_scollbar">
    <div class="detail_info_panel">
    
    	<?php echo $form -> create('companys', array('action' => 'editapplyjob','type'=> 'post','onsubmit'=>'return  checkedinfo()') ); ?>
		<div class="details_item_line">
	      <div class="details_item">
	      <div class="form_left_title left">职位类别：</div>
	      <div class="form_right_e_input left"><?php echo $form->text('CompJobapply.category');?></div>
	       <div id='categorymessage' style='display:none;' class="error_message">请填写职位类别</div>
	      </div>
		</div>
		
		<div class="details_item_line">
	      <div class="details_item">
		      <div class="form_left_title left">招聘人数：</div>
		      <div class="form_right_e_input left"><?php echo $form->text('CompJobapply.numberofapply',array("placeholder"=>"0","onkeydown"=>" checkpricekeyup2(this,event)"));?></div>
		       <div id='numbermessage' style='display:none;' class="error_message">请填写招聘人数</div>
	      </div>
		</div>
		
	    <div class="details_item_line">
			<div class="details_item">
			    <div class="form_left_title left">发布日期：</div>
			    <div class="form_right_e_input form_date_picker left">
			    	<?php echo $form->text('CompJobapply.releasedate',array("maxlength"=>"10","style"=>"width:130px","onfocus"=>"WdatePicker()"));?>
			    </div>
			    <div id='datemessage' style='display:none;' class="error_message">请选择发布日期</div>
			</div>
	   </div>
		
		<div class="details_item_line">
	      <div class="details_item">
	      <div class="form_left_title left">职位描述：</div>
	      <div class="form_right_e_input left"><?php echo $form->textarea('CompJobapply.jobdesc',array('class' => 'form_textarea','wrap'=>'virtual'));?></div>
	       <div id='descmessage' style='display:none;' class="error_message">请填写职位要求/描述</div>
	      </div>
		</div>
		
		 <div class="details_item_line">
			<div class="details_item">
				<div class="form_left_title left"></div>
		        <div class="form_add_submit left">
		        	<?php echo $form->submit(__('Save',true), array("id"=>"addactive","name"=>"submit","class"=>"buttom","div"=>false));  ?>
		            <?php echo $form->hidden('CompJobapply.cid',array("value"=>$companyid)) ;?>
		        	<?php echo $form->hidden('CompJobapply.id') ?>
		        </div>
			</div>
		</div>
		
		
    </div>
</div>

<script>

function checkedinfo(){
	 if($("#CompJobapplyCategory").val().trim() == ''){
			$("#categorymessage").css('display','block');
			return false;
	  }else{
		 	 $("#categorymessage").css('display','none');
		  }
		  
	  if($("#CompJobapplyNumberofapply").val().trim() == ''){
			$("#numbermessage").css('display','block');
			return false;
	  }else{
		 	 $("#numbermessage").css('display','none');
		  }
		  
	   if($("#CompJobapplyReleasedate").val().trim() == ''){
			$("#datemessage").css('display','block');
			return false;
	  }else{
		 	 $("#datemessage").css('display','none');
		  }
		
	 if($("#CompJobapplyJobdesc").val().trim() == '')
	 {
			$("#descmessage").css('display','block');
			return false;
	  }else{
		 	 $("#descmessage").css('display','none');
		  }
}
</script>
